package cc.bluemc.modules.generateCode.action;

import cc.bluemc.modules.generateCode.entity.FileStruct;
import cc.bluemc.modules.generateCode.service.impl.GenerateTableService;
import cc.bluemc.platform.comm.BaseAction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/generate/tb")
public class GenerateTableAction extends BaseAction{
	
	@Autowired
	private GenerateTableService service;

	@RequestMapping("getBeans")
	public String getFile(ModelMap map) throws Exception{
		FileStruct fileStruct= service.getFiles(getBasePath()+"com//ristone//modules//sal");
		String sql = service.createTbSql(fileStruct);
		System.out.println(sql);
		map.put("files",fileStruct);
		return "";
	}
}
